#!/usr/bin/python
#encoding=utf-8

import urllib2

def get_qq_status_int(uid):
	url = "http://webpresence.qq.com/getonline?Type=1&"+str(uid)+":"
	response = urllib2.urlopen(url)
	html = response.read()
	if html[-2] == '0':
		ret = 'offline'
	elif html[-2] == '1':
		ret = 'online'
	else:
		ret = 'unknown'
	return ret

if __name__ == "__main__":
	get_qq_status_int(396968903)
